﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using SecurityApi.DataAccess;

namespace SecurityApi.WebApi.Controllers
{
    public class ApplicationController : ApiController
    {
        // GET api/application
        [HttpGet]
        public List<SecurityApi.Model.Application> Get()
        {
            ApplicationRepository repository = new ApplicationRepository();
            var query = repository.GetAll();
            List<SecurityApi.Model.Application> list = query.ToList();
            return list;
        }

        // GET api/application/5
        [HttpGet]
        public SecurityApi.Model.Application Get(int id)
        {
            ApplicationRepository repository = new ApplicationRepository();
            var application = repository.GetApplicationById(id);
            return application;
        }

        //// POST api/application
        //public void Post([FromBody]string value)
        //{
        //}

        //// PUT api/application/5
        //public void Put(int id, [FromBody]string value)
        //{
        //}

        //// DELETE api/application/5
        //public void Delete(int id)
        //{
        //}
    }
}
